home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / doc / quel / quel.doc < prev    next >
Encoding:
Text File  |  1992-11-19  |  26.1 KB  |  600 lines

  1.  
  2.  
  3.  
  4.  
  5.      QUEL(QUEL)                   2/23/79                   QUEL(QUEL)
  6.  
  7.  
  8.  
  9.      NAME
  10.           quel - QUEry Language for INGRES
  11.  
  12.      DESCRIPTION
  13.           The following is a description  of  the  general  syntax  of
  14.           QUEL.   Individual  QUEL statements and commands are treated
  15.           separately in the document; this section describes the  syn-
  16.           tactic  classes  from  which  the  constituent parts of QUEL
  17.           statements are drawn.
  18.  
  19.           1. Comments
  20.  
  21.           A comment is an arbitrary sequence of characters bounded  on
  22.           the left by ``/*'' and on the right by ``*/'':
  23.  
  24.           /* This is a comment */
  25.  
  26.           2. Names
  27.  
  28.           Names in QUEL are sequences of no more than 12  alphanumeric
  29.           characters,  starting  with an alphabetic. Underscore (_) is
  30.           considered an alphabetic.  All  upper-case  alphabetics  ap-
  31.           pearing  anywhere  except  in  strings are automatically and
  32.           silently mapped into their lower-case counterparts.
  33.  
  34.           3. Keywords
  35.  
  36.           The following identifiers are reserved for use  as  keywords
  37.           and may not be used otherwise:
  38.  
  39.                abs                 all                 and
  40.                any                 append              ascii
  41.                at                  atan                avg
  42.                avgu                by                  concat
  43.                copy                cos                 count
  44.                countu              create              define
  45.                delete              delim               destroy
  46.                exp                 float4              float8
  47.                from                gamma               help
  48.                in                  index               int1
  49.                int2                int4                integrity
  50.                into                is                  log
  51.                max                 min                 mod
  52.                modify              not                 of
  53.                on                  onto                or
  54.                permit              print               range
  55.                replace             retrieve            save
  56.                sin                 sqrt                sum
  57.                sumu                to                  unique
  58.                until               unuse               use
  59.                view                where
  60.  
  61.           4. Constants
  62.  
  63.           There are three types of  constants,  corresponding  to  the
  64.           three data types available in QUEL for data storage.
  65.  
  66.           4.1. String constants
  67.  
  68.           Strings in QUEL are sequences of no more than 255  arbitrary
  69.           ASCII  characters  bounded  by  double quotes ( " " ). Upper
  70.           case alphabetics  within  strings  are  accepted  literally.
  71.           Also,  in order to imbed quotes within strings, it is neces-
  72.           sary to prefix them with `\' .  The same convention  applies
  73.           to `\' itself.
  74.  
  75.           Only printing characters are allowed within  strings.   Non-
  76.           printing  characters (i.e. control characters) are converted
  77.           to blanks.
  78.  
  79.           4.2. Integer constants
  80.  
  81.           Integer constants  in  QUEL  range  from  -2,147,483,647  to
  82.           +2,147,483,647.  Integer constants beyond that range will be
  83.           converted to floating point.  If the integer is greater than
  84.           32,767  or  less  than -32,767 then it will be left as a two
  85.           byte integer.  Otherwise it is converted to a four byte  in-
  86.           teger.
  87.  
  88.           4.3. Floating point constants
  89.  
  90.           Floating constants consist of an  integer  part,  a  decimal
  91.           point,  and  a  fraction  part or scientific notation of the
  92.           following format:
  93.  
  94.                   {<dig>} [.<dig>] [e|E [+|-] {<dig>}]
  95.  
  96.           Where <dig> is a  digit,  []  represents  zero  or  one,  {}
  97.           represents  zero  or more, and | represents alternation.  An
  98.           exponent with a missing mantissa has a mantissa of 1 insert-
  99.           ed.   There  may  be  no  extra  characters  embedded in the
  100.           string.  Floating constants are taken to be double-precision
  101.           quantities  with a range of approximately -10**38 to +10**38
  102.           and a precision of 17 decimal digits.
  103.  
  104.           5. Attributes
  105.  
  106.           An attribute is a construction of the form:
  107.  
  108.                   variable.domain
  109.  
  110.           _V_a_r_i_a_b_l_e identifies a particular relation and can be thought
  111.           of  as  standing for the rows or tuples of that relation.  A
  112.           variable is associated with a relation by means of  a  _r_a_n_g_e
  113.           statement.   _D_o_m_a_i_n is the name of one of the columns of the
  114.           relation over which the variable ranges.  Together they make
  115.           up  an  attribute,  which  represents  values  of  the named
  116.           domain.
  117.  
  118.           If the attribute is a string type, it can be qualified  with
  119.           the  substring notation. The substring notation is explained
  120.           later.
  121.  
  122.           6. Operators
  123.  
  124.           6.1 Arithmetic operators
  125.  
  126.           Arithmetic  operators  take  numeric  type  expressions   as
  127.           operands.   Unary  operators  group  right  to  left; binary
  128.           operators group left to right. The operators  (in  order  of
  129.           descending precedence) are:
  130.  
  131.                   +,-     (unary) plus, minus
  132.                   **      exponentiation
  133.                   *,/     multiplication, division
  134.                   +,-     (binary) addition, subtraction
  135.  
  136.           Parentheses may be used for arbitrary grouping.   Arithmetic
  137.           overflow  and  divide  by  zero  are  not checked on integer
  138.           operations.  Floating point operations are checked for over-
  139.           flow,  underflow, and divide by zero only if the appropriate
  140.           machine hardware exists and has been enabled.
  141.  
  142.           6.2 Arithmetic string operators
  143.  
  144.           The operator + is a string concatenator, like the  HU  func-
  145.           tion  _c_o_n_c_a_t;  however,  its syntax is cleaner and it is not
  146.           limited to two arguments, but like its  arithmetic  counter-
  147.           part,  can be used without restriction.  Its counterpart, -,
  148.           is the string equivalent of the difference operator on sets,
  149.           with  the  special  property that only the first instance of
  150.           the right hand side is deleted from the string.  The binding
  151.           properties  of these two operators are exactly equivalent to
  152.           the arithmetic plus and minus, which means that they can  be
  153.           used in conjunction with parentheses to form complex expres-
  154.           sions.
  155.  
  156.           These two operators are most useful when used with the  sub-
  157.           string notation.
  158.  
  159.           7. Expressions (a_expr)
  160.  
  161.           An expression is one of the following:
  162.  
  163.                constant
  164.                attribute
  165.                functional expression
  166.                aggregate or aggregate function
  167.                a combination of numeric expressions and arithmetic operators
  168.  
  169.           For the purposes of this document, an  arbitrary  expression
  170.           will be refered to by the name _a__e_x_p_r.
  171.  
  172.           8. Formats
  173.  
  174.           Every _a__e_x_p_r has a format denoted by a letter (_c, _i,  or  _f,
  175.           for character, integer, or floating data types respectively)
  176.           and a number indicating the number of bytes of storage occu-
  177.           pied.   Formats  currently  supported are listed below.  The
  178.           ranges of numeric types are indicated in parentheses.
  179.  
  180.                c1 - c255      character data of length  1-255  charac-
  181.                               ters
  182.                i1             1-byte integer (-128 to +127)
  183.                i2             2-byte integer (-32768 to +32767)
  184.                i4             4-byte   integer    (-2,147,483,648   to
  185.                               +2,147,483,647)
  186.                f4             4-byte floating (-10**38 to  +10**38,  7
  187.                               decimal digit precision)
  188.                f8             8-byte floating (-10**38 to +10**38,  17
  189.                               decimal digit precision)
  190.  
  191.           One numeric format can be converted to  or  substituted  for
  192.           any other numeric format.
  193.  
  194.           9. Type Conversion.
  195.  
  196.           When operating on two numeric domains  of  different  types,
  197.           INGRES converts as necessary to make the types identical.
  198.  
  199.           When operating on an integer and a  floating  point  number,
  200.           the  integer  is converted to a floating point number before
  201.           the operation.  When operating on two integers of  different
  202.           sizes,  the  smaller is converted to the size of the larger.
  203.           When operating on two floating  point  number  of  different
  204.           size, the larger is converted to the smaller.
  205.  
  206.           The following table summarizes the possible combinations:
  207.  
  208.                       i1      i2      i4      f4      f8
  209.  
  210.               i1 -    i1      i2      i4      f4      f8
  211.               i2 -    i2      i2      i4      f4      f8
  212.               i4 -    i4      i4      i4      f4      f8
  213.               f4 -    f4      f4      f4      f4      f4
  214.               f8 -    f8      f8      f8      f4      f8
  215.  
  216.           INGRES provides five type conversion operators  specifically
  217.           for overriding the default actions.  The operators are:
  218.  
  219.               int1(a_expr)      result type i1
  220.               int2(a_expr)      result type i2
  221.               int4(a_expr)      result type i4
  222.               float4(a_expr)    result type f4
  223.               float8(a_expr)    result type f8
  224.  
  225.           The type conversion operators convert their argument  a_expr
  226.           to  the  requested  type.   _A__e_x_p_r can be anything including
  227.           character.  If a character value cannot be converted, an er-
  228.           ror  occures and processing is halted.  This can happen only
  229.           if the syntax of the character value is incorrect.
  230.  
  231.           Overflow is not checked on conversion.
  232.  
  233.           10. Target_list
  234.  
  235.           A target list is a parenthesized, comma  separated  list  of
  236.           one  or  more elements , each of which must be of one of the
  237.           following forms:
  238.  
  239.           a) _r_e_s_u_l_t__a_t_t_n_a_m_e _i_s _a__e_x_p_r
  240.  
  241.           _R_e_s_u_l_t__a_t_t_n_a_m_e is the name of the attribute  to  be  created
  242.           (or an already existing attribute name in the case of update
  243.           statements.) The equal sign (``='') may be used interchange-
  244.           ably  with  _i_s.   In the case where _a__e_x_p_r is anything other
  245.           than a single attribute, this form must be used to assign  a
  246.           result name to the expression.
  247.  
  248.           b) _a_t_t_r_i_b_u_t_e
  249.  
  250.           In the case of a _r_e_t_r_i_e_v_e, the resultant domain will acquire
  251.           the  same name as that of the attribute being retrieved.  In
  252.           the case of update statements (_a_p_p_e_n_d, _r_e_p_l_a_c_e),  the  rela-
  253.           tion  being  updated  must  have  a domain with exactly that
  254.           name.
  255.  
  256.           Inside the target list  the  keyword  _a_l_l  can  be  used  to
  257.           represent all domains.  For example:
  258.  
  259.                range of e is employee
  260.                retrieve (e.all) where e.salary > 10000
  261.  
  262.           will retrieve all domains of employee for those tuples which
  263.           satisfy  the  qualification.   _A_l_l can be used in the target
  264.           list of a _r_e_t_r_i_e_v_e or an _a_p_p_e_n_d.  The domains  will  be  in-
  265.           serted  in  their  ``create'' order, that is, the same order
  266.           they were listed in the _c_r_e_a_t_e statement.
  267.  
  268.           11. Comparison operators
  269.  
  270.           Comparison operators take arbitrary expressions as operands.
  271.  
  272.                   <       (less than)
  273.                   <=      (less than or equal)
  274.                   >       (greater than)
  275.                   >=      (greater than or equal)
  276.                   =       (equal to)
  277.                   !=      (not equal to)
  278.  
  279.           They are all of equal precedence.  When comparisons are made
  280.           on character attributes, all blanks are ignored.
  281.  
  282.           12. Logical operators
  283.  
  284.           Logical operators take clauses as operands and  group  left-
  285.           to-right:
  286.  
  287.                   not     (logical not; negation)
  288.                   and     (logical and; conjunction)
  289.                   or      (logical or; disjunction)
  290.  
  291.           _N_o_t has the highest precedence of the  three.   _A_n_d  and  _o_r
  292.           have  equal  precedence.   Parentheses may be used for arbi-
  293.           trary grouping.
  294.  
  295.           13. Qualification (qual)
  296.  
  297.           A _q_u_a_l_i_f_i_c_a_t_i_o_n consists of any number of clauses  connected
  298.           by  logical  operators.   A clause  is a pair of expressions
  299.           connected by a comparison operator:
  300.  
  301.                   a_expr comparison_operator a_expr
  302.  
  303.           Parentheses may be used for arbitrary grouping.  A  qualifi-
  304.           cation may thus be:
  305.  
  306.               _c_l_a_u_s_e
  307.               _n_o_t _q_u_a_l
  308.               _q_u_a_l _o_r _q_u_a_l
  309.               _q_u_a_l _a_n_d _q_u_a_l
  310.               ( _q_u_a_l )
  311.  
  312.           14. Functional expressions
  313.  
  314.           A _f_u_n_c_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n consists of a function name followed
  315.           by a parenthesized (list of) operand(s).  Functional expres-
  316.           sions can be nested to any level.  In the following list  of
  317.           functions supported (_n) represents an arbitrary numeric type
  318.           expression.  The format of the result is  indicated  on  the
  319.           right.
  320.  
  321.                abs(_n) -       same as _n (absolute value)
  322.                ascii(_n) -     character string  (converts  numeric  to
  323.                               character)
  324.                atan(_n) -      f8 (arctangent)
  325.                concat(_a,_b) -  character (character concatenation.  See
  326.                               16.2)
  327.                cos(_n) -       f8 (cosine)
  328.                exp(_n) -       f8 (exponential of _n)
  329.                gamma(_n) -     f8 (log gamma)
  330.                log(_n) -       f8 (natural logarithm)
  331.                mod(_n,_b) -     same as _b (_n modulo _b. _n and _b  must  be
  332.                               i1, i2, or i4)
  333.                sin(_n) -       f8 (sine)
  334.                sqrt(_n) -      f8 (square root)
  335.  
  336.           15. Aggregate expressions
  337.  
  338.           Aggregate expressions provide a way to aggregate a  computed
  339.           expression over a set of tuples.
  340.  
  341.           15.1. Aggregation operators
  342.  
  343.           The definitions of the aggregates are listed below.
  344.  
  345.                count -        (i4) count of occurrences
  346.                countu -       (i4) count of unique occurrences
  347.                sum -          summation
  348.                sumu -         summation of unique values
  349.                avg -          (f8) average (sum/count)
  350.                avgu -         (f8) unique average (sumu/countu)
  351.                max -          maximum
  352.                min -          minimum
  353.                any -          (i2) value is 1 if  any  tuples  satisfy
  354.                               the qualification, else it is 0
  355.  
  356.           15.2. Simple aggregate
  357.  
  358.                   _a_g_g_r_e_g_a_t_i_o_n__o_p_e_r_a_t_o_r (_a__e_x_p_r [ _w_h_e_r_e _q_u_a_l ] )
  359.  
  360.           A simple aggregate  evaluates  to  a  single  scalar  value.
  361.           _A__e_x_p_r  is  aggregated over the set of tuples satisfying the
  362.           qualification (or all tuples in the range of the  expression
  363.           if  no qualification is present).  Operators _s_u_m and _a_v_g re-
  364.           quire numeric type _a__e_x_p_r; _c_o_u_n_t, _a_n_y, _m_a_x and _m_i_n permit  a
  365.           character type attribute as well as numeric type _a__e_x_p_r.
  366.  
  367.           _S_i_m_p_l_e _a_g_g_r_e_g_a_t_e_s _a_r_e _c_o_m_p_l_e_t_e_l_y _l_o_c_a_l.  That is,  they  are
  368.           logically  removed from the query, processed separately, and
  369.  
  370.           15.3. ``_a_n_y'' aggregate
  371.  
  372.           It is sometimes useful to know if any tuples satisfy a  par-
  373.           ticular  qualification.   One  way of doing this is by using
  374.           the aggregate _c_o_u_n_t and checking whether the return is  zero
  375.           or  non-zero.   Using _a_n_y instead of _c_o_u_n_t is more efficient
  376.           since processing is stopped, if possible, the first  time  a
  377.           tuple satisfies a qualification.
  378.  
  379.           _A_n_y returns 1 if the qualification is true and 0 otherwise.
  380.  
  381.           15.4. Aggregate functions
  382.  
  383.                   _a_g_g_r_e_g_a_t_i_o_n__o_p_e_r_a_t_o_r (_a__e_x_p_r _b_y _b_y__d_o_m_a_i_n
  384.                           {, _b_y__d_o_m_a_i_n} [ _w_h_e_r_e _q_u_a_l ] )
  385.  
  386.           Aggregate functions are  extensions  of  simple  aggregates.
  387.           The _b_y operator groups (i.e. partitions) the set of qualify-
  388.           ing  tuples  by  _b_y__d_o_m_a_i_n  values.   For  more   than   one
  389.           _b_y__d_o_m_a_i_n,  the values which are grouped by are the concate-
  390.           nation of individual _b_y__d_o_m_a_i_n values.  _A__e_x_p_r is as in sim-
  391.           ple  aggregates.   The aggregate function evaluates to a set
  392.           of aggregate results, one for each partition into which  the
  393.           set  of  qualifying  tuples has been grouped.  The aggregate
  394.           value used during evaluation of the query is the value asso-
  395.           ciated with the partition into which the tuple currently be-
  396.           ing processed would fall.
  397.  
  398.           Unlike simple aggregates, aggregate functions are  not  com-
  399.           pletely  local.  The _b_y__l_i_s_t, which differentiates aggregate
  400.           functions from simple aggregates, is global  to  the  query.
  401.           Domains in the _b_y__l_i_s_t are automatically linked to the other
  402.           domains in the query which are in the same relation.
  403.  
  404.           Example:
  405.                   /* retrieve the average salary for the employees
  406.                   working for each manager */
  407.                   range of e is employee
  408.                   retrieve (e.manager, avesal=avg(e.salary by e.manager))
  409.  
  410.           15.5 Aggregates on Unique Values.
  411.  
  412.           It is occasionally necessary to aggregate on  unique  values
  413.           of an expression.  The _a_v_g_u, _s_u_m_u, and _c_o_u_n_t_u aggregates all
  414.           remove duplicate values before performing  the  aggregation.
  415.           For example:
  416.  
  417.                   count(e.manager)
  418.  
  419.           would tell you how many occurrences of _e._m_a_n_a_g_e_r exist.  But
  420.  
  421.                   countu(e.manager)
  422.  
  423.           would tell you how many unique values of _e._m_a_n_a_g_e_r exist.
  424.  
  425.           16. Special character operators
  426.  
  427.           There are four special  features  which  are  particular  to
  428.           character domains.
  429.  
  430.           16.1 Pattern matching characters
  431.  
  432.           There are eleven characters which take  on  special  meaning
  433.           when used in character constants (strings):
  434.  
  435.               *     matches any string of zero or more characters.
  436.               ?     matches any single character.
  437.               [..]  matches any of characters in the brackets.
  438.               ##1   matches any string of zero or more characters.
  439.               ##2   matches any string of zero or more characters.
  440.               ##3   matches any string of zero or more characters.
  441.               ##4   matches any string of zero or more characters.
  442.               ##5   matches any string of zero or more characters.
  443.               ##6   matches any string of zero or more characters.
  444.               ##7   matches any string of zero or more characters.
  445.               ##8   matches any string of zero or more characters.
  446.               ##9   matches any string of zero or more characters.
  447.               ##0   matches all instances of strings between two occu-
  448.                     rances of ##0.
  449.  
  450.           These characters can be used in any combination  to  form  a
  451.           variety of tests.  For example:
  452.  
  453.                where e.name = "##1Kalash##2Joe##4" - matches any occu-
  454.                                    rance   of  "Kalash",  followed  by
  455.                                    "Joe".
  456.                where e.name = "##0Ingres##0" - matches all  occurances
  457.                                    of "Ingres" within a line.
  458.                where e.name = "*" - matches any name.
  459.                where e.name = "E*" - matches any  name  starting  with
  460.                                    "E".
  461.                where e.name = "*ein" - matches all names  ending  with
  462.                                    "ein"
  463.                where e.name = "*[aeiou]*" - matches any name  with  at
  464.                                    least one vowel.
  465.                where e.name = "Allman?" - matches any seven  character
  466.                                    name starting with "Allman".
  467.                where e.name = "[A-J]*" -  matches  any  name  starting
  468.                                    with A,B,..,J.
  469.  
  470.           The special meaning of the pattern matching  characters  can
  471.           be  disabled  by  preceding  them  with  a `\'.  Thus ``\*''
  472.           refers to the character ``*''.  When the special  characters
  473.           appear  in  the target list they must be escaped.  For exam-
  474.           ple:
  475.  
  476.                   title = "\*\*\* ingres \*\*\*"
  477.  
  478.           is the correct way to assign the string ``***  ingres  ***''
  479.           to the domain ``title''.
  480.  
  481.           16.1.1 Numbered Wildcards
  482.  
  483.           The numbered wildcards are unique in that they may also  ap-
  484.           pear  in a target list, as well as in a qualification.  Each
  485.           unique numbered wildcard used  retains  the  same  value  in
  486.           both  the  target  list  and the qualification list.  Thus a
  487.           query such as
  488.  
  489.                replace t(text = "##1the##2")
  490.                     where t.text = "##1THE##2"
  491.  
  492.           will replace an occurence of "THE" in t.text with "the".
  493.  
  494.           The special global wildcard ##0 when used in the query
  495.  
  496.                replace t(text = "##0the##0")
  497.                     where t.text = "##0THE##0"
  498.  
  499.           will replace all occurrences of "THE" with "the".
  500.  
  501.           16.2 Concatenation
  502.  
  503.           There is a concatenation operator which can form one charac-
  504.           ter   string  from  two.   Its  syntax  is  ``concat(field1,
  505.           field2)''.  The size of the new character string is the  sum
  506.           of  the  sizes  of  the  original  two.  Trailing blanks are
  507.           trimmed from the first  field,  the  second  field  is  con-
  508.           catenated  and  the remainder is blank padded. The result is
  509.           never trimmed to 0 length, however.   Concat  can  be  arbi-
  510.           trarily nested inside other concats. For example:
  511.  
  512.                   name = concat(concat(x.lastname, ","), x.firstname)
  513.  
  514.           will concatenate x.lastname with a comma and then  concaten-
  515.           ate x.firstname to that.
  516.  
  517.           16.3 Ascii (numeric to character translation)
  518.  
  519.           The _a_s_c_i_i function can be used to convert a numeric field to
  520.           its character representation.  This can be useful when it is
  521.           desired to compare a numeric value with a  character  value.
  522.           For example:
  523.  
  524.                   retrieve ( ... )
  525.                           where x.chardomain = ascii(x.numdomain)
  526.  
  527.           _A_s_c_i_i can be applied to a character value.   The  result  is
  528.           simply  the  character value unchanged.  The numeric conver-
  529.           sion formats are determined by  the  printing  formats  (see
  530.           ingres(unix)).
  531.  
  532.           16.4 Substring notation
  533.  
  534.           Any string attribute can be broken up into  into  a  smaller
  535.           substring using the following substring operators.
  536.  
  537.                   variable.domain(X,Y)
  538.                   variable.domain(X,Y%
  539.                   variable.domain%X,Y)
  540.                   variable.domain%X,Y%
  541.           Each of the above represents a certain substring of  _d_o_m_a_i_n,
  542.           denoted  by the endpoints X and Y. Whether the endpoints are
  543.           to be included or not is determined by the parentheses  (ex-
  544.           clusion) and percent signs (inclusion).
  545.  
  546.           _X and _Y (optional) consist of a required part with  optional
  547.           qualifiers. The required part can be any of the following:
  548.  
  549.           a string
  550.           w  (a word)
  551.           c  (a character)
  552.           A user defined delimiter (see delim(quel))
  553.  
  554.           The optional qualifiers are  a  preceding  digit,  _i,  which
  555.           specifies to look for the  _i_t_h  occurence, and a trailing $,
  556.           which specifies to search backwards  from  the  end  of  the
  557.           string.
  558.  
  559.           The rules for searching are very simple.  Without the $, the
  560.           value  of  _X chosen is the _i_t_h occurrance (the default value
  561.           of _i is one) from the left end of the  string.   The  search
  562.           for  _Y,  if  it  is requested, starts after the end of _X.  A
  563.           dollar sign, however, always specifies that the search start
  564.           from  the  end  of  the string regardless of the value of _X.
  565.           For illustrative purposes, assume a text  field  to  contain
  566.           the following:
  567.  
  568.           I saw the dog, the cat, and the duck take a walk.
  569.           Then  the  following  constructs  would  have  the  attached
  570.           values:
  571.  
  572.           r.text(3w,2"the"%       dog, the cat, and the
  573.           r.text%2"the"$,$%       the cat, and the duck take a walk.
  574.  
  575.           When combined with the arithemtic string operators this  fa-
  576.           cility  can  the quite powerful.  For example, to remove the
  577.           dog from the sentence requires  only  the  simple  following
  578.           query:
  579.  
  580.           replace r(text = r.text - r.text%"the","the"))
  581.           Or perhaps only the baby duck was taking a walk:
  582.  
  583.           replace r(text = r.text%"I","the"% + "baby" + r.text%"duck",$))
  584.  
  585.      SEE ALSO
  586.           append(quel),   delete(quel),   delim(quel),    range(quel),
  587.           replace(quel), retrieve(quel), ingres(unix)
  588.  
  589.      BUGS
  590.           The maximum number of variables  which  can  appear  in  one
  591.           query is 10.
  592.  
  593.           Numeric overflow, underflow, and  divide  by  zero  are  not
  594.           detected.
  595.  
  596.           When converting  between  numeric  types,  overflow  is  not
  597.           checked.
  598.  
  599.  
  600.